package com.xinqi.common.base.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.annotations.Describe;
import lombok.Getter;

/**
 * 题目类别
 * <p>
 * 备课区题型，1:主观题；2:客观题；
 * </p>
 *
 * @author linkai
 * @date 2023/07/02
 */
@Describe("题型")
public enum QuestionCategoryEnum implements BaseEnum {

    主观题("1", "主观题"),
    客观题("2", "客观题"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    QuestionCategoryEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static QuestionCategoryEnum of(String code) {
        return BaseEnum.of(QuestionCategoryEnum.class, code);
    }

}
